/*#include <stdio.h>*/
#include <iostream>



int getTypeIndex(char type){
    if(type == 'c'){
        return 0;
    }
    if (type == 'r'){
        return 1;
    }
    if (type == 'f'){
        return 2;
    }
    return -1;
}

int main() {
   int n;
    int m[3] = {0};
    scanf("%d",&n);

    int a; //输入的动物数量
    for (int i = 0; i < n; ++i) {
        char t; //动物类型
        scanf("%d %c",&a,&t);
        int index = getTypeIndex(t);
        m[index] += a;
    }
    int sum = 0;
    sum=m[0]+m[1]+m[2];

    printf("Total : %d animals\n",sum);
    printf("Total coneys: %d\n",m[0]);
    printf("Total rats :%d\n",m[1]);
    printf("Total frogs: %d\n",m[2]);
    printf("Percentage of coneys: %.2lf%%\n",(double)m[0]/sum*100);
    printf("Percentage of rats: %.2lf%%\n",(double)m[1]/sum*100);
    printf("Percentage of frogs: %.2lf%%\n",(double)m[2]/sum*100);
    return 0;
}
